package com.hq.user.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hq.user.entity.SysRoleMenu;
import com.hq.user.service.SysRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/sysRoleMenu")
public class SysRoleMenuController {
    @Autowired
    private SysRoleMenuService sysRoleMenuService;

    @GetMapping
    public Object getPage(Page page, SysRoleMenu sysRoleMenu) {
        return sysRoleMenuService.page(page, Wrappers.query(sysRoleMenu));
    }

    @PostMapping
    public Object Save(@RequestBody SysRoleMenu sysRoleMenu) {
        return sysRoleMenuService.save(sysRoleMenu);
    }

    @PutMapping
    public Object update(@RequestBody SysRoleMenu sysRoleMenu) {
        return sysRoleMenuService.updateById(sysRoleMenu);
    }
}
